package com.seecen.cywbackend.mapper;

import com.seecen.cywbackend.pojo.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
* @author lenovo
* @description 针对表【t_comment(评论表)】的数据库操作Mapper
* @createDate 2025-03-25 17:14:24
* @Entity com.seecen.cywbackend.pojo.Comment
*/
public interface CommentMapper extends BaseMapper<Comment> {

    @Select("select max(floor) from t_comment where dynamic_id = #{dynamicId}")
    Integer selectMaxFloor(Integer dynamicId);

    @Select("update t_comment set like_count = like_count - 1 where id = #{commentId}")
    void decrementLikeCount(Integer commentId);

    @Select("update t_comment set like_count = like_count + 1 where id = #{commentId}")
    void incrementLikeCount(Integer commentId);
}




